home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / PPP Interfaces 1.2 / PPP test ƒ / PPP test.c next >
Encoding:
C/C++ Source or Header  |  1995-10-22  |  1.0 KB  |  61 lines  |  [TEXT/CWIE]

  1. // A little test app for ppp.interface.lib.
  2. // Uses just the console interface.
  3. // © 1994 Richard Buckle <richardb@cocytus.demon.co.uk>
  4.  
  5. #include <ppp.interface.h>
  6. #include <stdio.h>
  7.  
  8. void main( void )
  9.     {
  10.     short theChoice = 1;
  11.     
  12.     // Use the file menu to quit
  13.     while(theChoice)
  14.         {
  15.         printf( "\n"
  16.                 "1. Is PPP installed?\n"
  17.                 "2. Is PPP open?\n"
  18.                 "3. Open PPP.\n"
  19.                 "4. Close PPP hard.\n"
  20.                 "5. Close PPP soft.\n" );
  21.                 
  22.         scanf( "%hi", &theChoice );
  23.         
  24.         switch( theChoice )
  25.             {
  26.             case 1:
  27.                 if(PPPisInstalled())
  28.                     printf("PPP is installed\n");
  29.                 else
  30.                     printf("PPP is not installed\n");
  31.                 break;
  32.             
  33.             case 2:
  34.                 if(PPPisOpen())
  35.                     printf("PPP is open\n");
  36.                 else
  37.                     printf("PPP is not open\n");
  38.                 break;
  39.             
  40.             case 3:
  41.                 printf("Opening PPP…\n");
  42.                 OpenPPP();
  43.                 break;
  44.             
  45.             case 4:
  46.                 printf("Hard closing PPP…\n");
  47.                 ClosePPPHard();
  48.                 break;
  49.             
  50.             case 5:
  51.                 printf("Soft closing PPP…\n");
  52.                 ClosePPPSoft();
  53.                 break;
  54.             
  55.             default:
  56.                 printf("Not a valid choice.\n");
  57.                 SysBeep(0);
  58.                 break;
  59.             }
  60.         }
  61.     }